﻿@page "/fortunes"
@inject Db Db
<!DOCTYPE html>
<html>
<head>
    <title>Fortunes</title>
</head>
<body>
    @if (rows is not null)
    {
        <table>
            <tr><th>id</th><th>message</th></tr>
            @foreach (var item in rows)
            {
                <tr><td>@item.Id</td><td>@item.Message</td></tr>
            }
        </table>
    }
</body>
</html>
@code {
    List<Fortune>? rows;

    protected override async Task OnInitializedAsync()
    {
        rows = await Db.LoadFortunesRowsDapper();
    }
}
